// 登录的实现需要用到的接口

import { client } from './client'

export const QUERY_BLOG = (params) =>
  client({
    url: '/api/vblog/v1/blogs',
    method: 'GET',
    // query string 参数
    // params: params
    params,
  })

export const DESCRIBE_BLOG = (blog_id) =>
  client({
    url: `/api/vblog/v1/blogs/${blog_id}`,
    method: 'GET',
  })

export const CREATE_BLOG = (data) =>
  client({
    url: '/api/vblog/v1/blogs',
    method: 'POST',
    data,
  })

export const UPDATE_BLOG = (blog_id, data) =>
  client({
    url: `/api/vblog/v1/blogs/${blog_id}`,
    method: 'PUT',
    data,
  })

export const PUBLISH_BLOG = (blog_id, data) =>
  client({
    url: `/api/vblog/v1/blogs/${blog_id}/publish`,
    method: 'POST',
    data,
  })

export const DELTE_BLOG = (blog_id) =>
  client({
    url: `/api/vblog/v1/blogs/${blog_id}`,
    method: 'DELETE',
  })
